package proxy_pattern.dynamic.forum;

/**
 * @author 申书航
 * @version 1.0
 */
public class ForumFunction implements VisitFunction{

    private UserDAO ud = new UserDAO();

    @Override
    public boolean register(User user) {
        return ud.addUser(user);
    }

    @Override
    public void modifyUser(User user) {
        System.out.println("修改数据成功");
    }

    @Override
    public void publishPost(User user, Post post) {
        System.out.println("发帖成功");
    }

    @Override
    public void modifyPost(User user, Post post) {
        System.out.println("修改帖子成功");
    }

    @Override
    public void viewPost(User user, Post post) {
        System.out.println("访问帖子成功");
    }
}
